<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>更新整站</title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/admin.css">
		<link rel="stylesheet" href="/static/web/css/daterangepicker.css">
		<script src="/static/web/js/jquery.min.js"></script>
		<script src="/static/web/js/moment.min.js"></script>
		<script src="/static/web/js/daterangepicker.js"></script>
	</head>
	<body>
		<form name="form1" action="makehtml_all.php" target="stafrm" method="post">
			<input type="hidden" name="action" value="make">
			<table class="table shadow-sm my-3">
				<tr>
					<td colspan="2">更新整站</td>
				</tr>
				<tr>
					<td width="260">更新选项：</td>
					<td>
						<label><input type="radio" name="uptype" id="uptype1" onclick="SelUp();" value="time" checked> 指定时间的所有更新</label>
						<label><input type="radio" name="uptype" id="uptype2" onclick="SelUp();" value="id"> 指定文档的所有更新</label>
						<label><input type="radio" name="uptype" id="uptype3" onclick="SelUp();" value="mkall"> 更新所有</label>
					</td>
				</tr>
				<tr id="seltime">
					<td>起始时间：</td>
					<td><input type="text" name="starttime" id="starttime" value="<?php echo GetDateMk(time());?>" class="datepicker admin-input-sm"></td>
				</tr>
				<tr id="selid" style="display:none">
					<td>起始id：</td>
					<td><input type="text" name="startid" id="startid" value="0" class="admin-input-sm"></td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<button type="submit" name="submit" class="btn btn-success btn-sm">开始更新</button>
						<button type="button" class="btn btn-outline-success btn-sm" onclick="location='sys_cache_up.php';">更新缓存</button>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<div id="mdv" class="admin-win-iframe"><iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe></div>
					</td>
				</tr>
			</table>
		</form>
		<script>
			function SelUp() {
				var ob1 = document.getElementById("uptype1");
				var ob2 = document.getElementById("uptype2");
				var ob3 = document.getElementById("uptype3");
				if (ob1.checked) {
					document.getElementById("seltime").style.display = '';
					document.getElementById("selid").style.display = "none";
				} else if (ob2.checked) {
					document.getElementById("seltime").style.display = "none";
					document.getElementById("selid").style.display = '';
				} else {
					document.getElementById("seltime").style.display = "none";
					document.getElementById("selid").style.display = "none";
				}
			}
			$(document).ready(function() {
				$('.datepicker').daterangepicker({
					"singleDatePicker": true,
					"autoApply": true,
					"showDropdowns": true,
					"linkedCalendars": false,
					"timePicker": true,
					"timePicker24Hour": true,
					"showCustomRangeLabel": false,
					ranges: {
						'今日': [moment(), moment()],
						'昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
						'本月': [moment().startOf('month'), moment().startOf('month')],
						'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month')
							.startOf('month')
						]
					},
					"locale": {
						format: 'YYYY-MM-DD HH:mm',
						applyLabel: '确定',
						cancelLabel: '取消',
						daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
						monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
						firstDay: 1
					}
				}, function(start) {
					$(this).val(start.format("YYYY-MM-DD HH:mm"));
				});
			});
		</script>
	</body>
</html>